import typing

# 题目：输入数字N, 按顺序打印出从1到最大的n位十进制数，比如输入3，则打印出1、2、3、……、999

def print2max_n_digit(n:int):
    if n<=0:
        return

    nums = [0 for i in range(n)]
    for i in range(10):
        nums[0] = '%d'%i
        print2max_n_digit_rescursively(nums, n, 0)




def print2max_n_digit_rescursively(nums, length, index):
    if index == length -1:
        print_number(nums)
        return
    for i in range(10):
        nums[index+1] = '%d'%i
        print2max_n_digit_rescursively(nums, length, index+1)




def print_number(num):
    is_begin = True
    length = len(num)
    for i in range(length):
        if is_begin and num[i] != '0':
            is_begin  = False
        if not is_begin:
            print(num[i], end='')
    print()


if __name__ == '__main__':
    print2max_n_digit(3)